<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>lwb的博客</title>
    <style>
        ul {
            list-style-type: none;
            margin: 0;
            padding: 0;
            overflow: hidden;
            background-color: #333;
            text-align: center;
        }
        li {
            display: inline-block;
        }

        li a {
            display: block;
            color: white;
            text-align: center;
            padding: 14px 16px;
            text-decoration: none;
        }

        li a:hover {
            background-color: #1747e1;
        }
        .footer {
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            align-items: center;
            height: 300px;
            border: 1px solid 
        }
        .text {
            margin-bottom: auto;
        }

    </style>
</head>

<body>

<ul class="nav">
    <li><a href="index.php">网站首页</a></li>
    <li><a href="#"></a></li>
    <li><a href="file.php">文件操作</a></li>
    <li><a href="login.php">登陆</a></li>
</ul>


<div style="width: 600px;height: 600px;margin: 200px auto;">
<?php
include "conn.php";
$id = 1;
$conn = new mysqli('localhost','root','root','myblog');
$sql = "SELECT * FROM news where id = $id" ;
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
        echo "<tr>";
        echo "<td>" . $row["body"]. "</td>";
        echo "<td>" . $row["author"]. "</td>";
        echo "</tr>";
    }
} else {
    echo "0 条结果";
}
?>
</div>
<div class="footer">
    <p class="text">&copy; 2024 My Blog</p>
</div>
